package com.xyzwps.paimon.furina.common.value

import com.xyzwps.paimon.furina.common.AppErrorCode
import com.xyzwps.paimon.furina.common.AppException

data class UserDescription(override val value: String) : StringValue {

    init {
        if (value.length > MAX_LENGTH) {
            throw AppException(AppErrorCode.USER_DESCRIPTION_FORMAT_INVALID, "用户描述长度不可超过 $MAX_LENGTH 个字符")
        }
    }

    companion object {
        const val MAX_LENGTH: Int = 100

        val EMPTY = UserDescription("")
    }
}
